﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SinaWeiboApp_sl.ViewModel;

namespace SinaWeiboApp_sl.View
{
    public partial class MainView : UserControl
    {
        public MainView(SinaWeiboClientV1.WeiboClient client)
        {
            InitializeComponent();
            ViewModel = new MainViewModel(client);
            ViewModel.View = this;
        }

        public MainViewModel ViewModel
        {
            get
            {
                return DataContext as MainViewModel;
            }
            set
            {
                if (value != null && value.View == null)
                {
                    value.View = this;
                }
                DataContext = value;
            }
        }

       
    }
}
